<?xml version='1.0' encoding='UTF-8' ?>

<!DOCTYPE composition PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">

<ui:composition xmlns:ui="http://java.sun.com/jsf/facelets"
                xmlns:h="http://java.sun.com/jsf/html"
                xmlns:f="http://java.sun.com/jsf/core"
                xmlns:p="http://primefaces.prime.com.tr/ui"
                template="./resources/template/layout.xhtml">

    <ui:define name="menu">
        &nbsp;
    </ui:define>

    <ui:define name="content">

        <div id="div-login">

            <h:form prependId="false">

                <p:panel id="panel" header="Efetuar Login">  

                    <p:messages id="msg" 
                                showDetail="true" 
                                showSummary="false" />

                    <img id="img-cadeado" 
                         src="#{facesContext.externalContext.requestContextPath}/resources/img/cadeado.jpg" 
                         border="0" 
                         width="90" 
                         height="80" />

                    <h:panelGrid id="grid" columns="2" cellpadding="5" style="float: right;">  

                        <h:outputLabel for="login" value="Usuário: " />  

                        <h:inputText id="login" 
                                     value="#{loginBean.login}"
                                     maxlength="10"
                                     style="width: 110px;"
                                     label="Nome"
                                     tabindex="1" />

                        <h:outputLabel for="senha" value="Senha: " />  

                        <h:inputSecret id="senha"
                                       value="#{loginBean.senha}"
                                       maxlength="10"
                                       style="width: 110px;"
                                       label="Senha"
                                       tabindex="2" />
                    </h:panelGrid>

                    <p:separator  />

                    <div style="text-align: right;">

                        <p:commandButton value="Login"
                                         image="ui-icon ui-icon-locked"
                                         ajax="false"
                                         action="#{loginBean.fazerLogin()}"
                                         update="grid msg"
                                         tabindex="3"
                                         style="width: 90px;" />

                    </div>

                </p:panel>

            </h:form>

        </div>

    </ui:define>

</ui:composition>
